<!DOCTYPE html>
<html>
<head>
    <title>学生信息</title>
    <#include "/iframe-header.html">
    <style type="text/css">
        td {
            height: 45px;
            text-align: center;
            vertical-align: center;
        }
    </style>
</head>
<body>
<div id="loading"
     style="position:absolute;z-index:1000;top:0px;left:0px;width:100%;height:100%;background:#DDDDDB;text-align :center;padding-top:20%;">
    <h5><img src="../../statics/plugins/layer/skin/default/loading-0.gif"/></h5>
</div>
<div class="easyui-layout" data-options="fit:true,border:false">
    <div data-options="region:'center',border:false" style="overflow: hidden;">
        <form id="editForm">
            <input name="id" type="hidden"/>
            <table style="padding: 20px;">
                <tr>
                    <td>姓名：</td>
                    <td><input type="text" class="easyui-textbox" name="name" id="name" data-options="prompt:'姓名'"></td>
                </tr>
                <tr>
                    <td>性别：</td>
                    <td>
                        <select type="text" class="easyui-combobox" style="width: 171px" name="sex"
                                id="sex" data-options="editable:false,panelHeight:'auto'">
                            <option value="男">男</option>
                            <option value="女">女</option>
                            <option value="未知">未知</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>学号：</td>
                    <td><input type="text" class="easyui-textbox" name="studentNo" id="studentNo"
                               data-options="prompt:'学号'"></td>
                </tr>
                <tr>
                    <td>学校：</td>
                    <td><input type="text" class="easyui-textbox" name="school" id="school" data-options="prompt:'学校'">
                    </td>
                </tr>
                <tr>
                    <td>老师：</td>
                    <td><input type="text" class="easyui-textbox" name="teacher" id="teacher"
                               data-options="prompt:'老师'"></td>
                </tr>
                <tr>
                    <td>专业：</td>
                    <td><input type="text" class="easyui-textbox" name="major" id="major" data-options="prompt:'专业'">
                    </td>
                </tr>
            </table>
        </form>
    </div>
</div>
<script type="text/javascript">
    var loading;
    $.parser.onComplete = function () {
        if (loading) clearTimeout(loading);
        loading = setTimeout(closes, 300);
    }

    function closes() {
        $('#loading').fadeOut('normal', function () {
            $(this).remove();
        });
    }

    var id = getUrlSearch("id");
    $(function () {
        loadForm(id);
    });

    function loadForm(id) {
        if (id) {
            $.ajax({
                type: "GET",
                url: applicationPath + '/sys/student/info/' + id,
                dataType: "json",
                success: function (data) {
                    $('#editForm').form("load", data.obj);
                }
            });
        }
    }
</script>
</body>
</html>